package com.bdmc.smokesensor.services;

import java.util.List;

import com.bdmc.smokesensor.dao.Sys_ValidateCodeJPA;
import com.bdmc.smokesensor.entity.Sys_ValidateCode;
import com.bdmc.smokesensor.iservices.ISys_ValidateCodeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;


@Service
public class Sys_ValidateCodeService extends BaseService<Sys_ValidateCode> implements ISys_ValidateCodeService {

    @Autowired
    private Sys_ValidateCodeJPA _codejpa;

    @Override
    public List<Sys_ValidateCode> findAll() {
        return _codejpa.findAll();
    }

    @Override
    public Sys_ValidateCode findOne(Example<Sys_ValidateCode> example) {
        return _codejpa.findOne(example).orElse(null);
    }

    @Override
    public Sys_ValidateCode findOneById(int id) {
        return _codejpa.findById(id).orElse(null);
    }

    @Override
    public Sys_ValidateCode save(Sys_ValidateCode code) {
        return _codejpa.save(code);
    }

    @Override
    public void deleteById(int id) {
        _codejpa.deleteById(id);
    }

    @Override
    public Sys_ValidateCode findByValidateCodeAndMobileAndIsUsedAndPurpose(String validateCode, String mobile,
            boolean isused, int purpose) {
        return _codejpa.findByValidateCodeAndMobileAndIsUsedAndPurpose(validateCode, mobile, isused, purpose);
    }

    @Override
    public Sys_ValidateCode findByMobileAndIsUsedAndPurpose(String mobile, boolean isused, int purpose) {
        return _codejpa.findByMobileAndIsUsedAndPurpose(mobile, isused, purpose);
    }


}